﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraSplashScreen;
using YDModel;
using YDServices;
using YDCommon;

namespace YDWin
{
    public partial class SplashScreen1 : SplashScreen
    {
        UserRoleService urs = new UserRoleService();
        public SplashScreen1()
        {
            InitializeComponent();
        }

        #region Overrides

        public override void ProcessCommand(Enum cmd, object arg)
        {
            base.ProcessCommand(cmd, arg);
        }

        #endregion

        public enum SplashScreenCommand
        {
           
        }

        private void SplashScreen1_Load(object sender, EventArgs e)
        {
            //获取用户权限 
            var user= Global.User;
            if(user!=null)
            {
                var list = urs.getUserPermission(user.ID);
                if (urs.HasError)
                {
                    Utils.ShowPrompt(MessageType.mtError, "" + urs.Errors);
                    urs.Errors.Clear();
                    return;
                }

                Global.UserPerList = list;
            }
        }
    }
}